package atlas;
//import atlas.atlas1;
import java.util.*;
public class atlas2 {
    public static void main(String[] args) {
        List<atlas1> menu= Arrays.asList(
                new atlas1("老人与海",50),
                new atlas1("杀死一只知更鸟",170),
                new atlas1("小王子",40),
                new atlas1("百年孤独",230),
                new atlas1("呼啸山庄",130),
                new atlas1("羊脂球",110),
                new atlas1("鼠疫",180));
        List<atlas1> lowCaloriesDish=new ArrayList<>();
        for(atlas1 d:menu)
        {
            if(d.getprice()>100)
                lowCaloriesDish.add(d);
        }
        Collections.sort(lowCaloriesDish,new Comparator<atlas1>() {
            @Override
            public int compare(atlas1 o1, atlas1 o2) {
                return Integer.compare((int) o1.getprice(), (int) o2.getprice());
            }
        });
        for(atlas1 d:lowCaloriesDish)
            System.out.println("书名:"+d.getName()+"  "+"价格:"+d.getprice());
    }
}
